﻿#include "ui_info.h"
#include "ui_ui_info.h"
#include "define.h"
#include <QMessageBox>

uiInfo::uiInfo(Cluster *cluster, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::uiInfo)
{
    ui->setupUi(this);
    this->m_c = cluster;

    ui->sn->setText(m_c->sn());
    ui->switchId->setText(m_c->switchId());
    ui->line->setText(m_c->line());
    ui->lineId->setText(m_c->lineId());
    ui->localDevCnt->setText(QString::number(m_c->localDevCnt()));

    ui->dhcp->setText(g_dhcp[m_c->dhcp()]);
    ui->ip->setText(m_c->ip());
    ui->mask->setText(m_c->mask());
    ui->gw->setText(m_c->gw());
    ui->dns1->setText(m_c->dns1());
    ui->dns2->setText(m_c->dns2());

    ui->hwVer->setText(m_c->hwVer());
    ui->swVer->setText(m_c->swVer());
    ui->swbTime->setText(m_c->swbTime());
    ui->logLevel->setText(g_logLevel[m_c->logLevel()]);
}

uiInfo::~uiInfo()
{
    delete ui;
}
